package cn.edu.xmist.proxy.staticproxy;

import cn.edu.xmist.proxy.Hello;

/**
 * 静态代理
 */
public class HelloProxy implements Hello {

    private Hello hello;

    public HelloProxy(Hello hello) {
        this.hello = hello;
    }

    @Override
    public void say(String name) {
        before();
        hello.say(name);
        after();
    }

    private void before() {
        System.out.println("我在前面");
    }

    private void after() {
        System.out.println("我在后面");
    }
}
